package com.huawei.hwid.usecase;

import android.content.Context;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.huawei.hwid.UseCase;
import com.huawei.hwid.c.a.b;
import com.huawei.hwid.core.constants.HwAccountConstants;
import com.huawei.hwid.core.d.b.e;
import java.util.ArrayList;

public class ReadHwAccountUseCase extends UseCase<RequestValues> {
    private Context a;

    public static final class RequestValues extends com.huawei.hwid.UseCase.RequestValues {
        public static final Creator<RequestValues> CREATOR = new Creator<RequestValues>() {
            public /* synthetic */ Object createFromParcel(Parcel parcel) {
                return a(parcel);
            }

            public /* synthetic */ Object[] newArray(int i) {
                return a(i);
            }

            public RequestValues a(Parcel parcel) {
                return new RequestValues(parcel);
            }

            public RequestValues[] a(int i) {
                return new RequestValues[i];
            }
        };
        boolean a;

        public RequestValues(boolean z) {
            this.a = z;
        }

        protected RequestValues(Parcel parcel) {
            boolean z = true;
            if (parcel.readByte() != (byte) 1) {
                z = false;
            }
            this.a = z;
        }

        public int describeContents() {
            return 0;
        }

        public void writeToParcel(Parcel parcel, int i) {
            parcel.writeByte((byte) (this.a ? 1 : 0));
        }
    }

    public /* synthetic */ void b(com.huawei.hwid.UseCase.RequestValues requestValues) {
        a((RequestValues) requestValues);
    }

    public ReadHwAccountUseCase(Context context) {
        this.a = context;
    }

    protected void a(RequestValues requestValues) {
        e.b("ReadHwAccountUseCase", "readHwAccount", true);
        ArrayList a = b.a("accounts.xml", this.a, requestValues.a);
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList(HwAccountConstants.ACCOUNT_KEY, a);
        b().a(bundle);
    }
}
